import os
from pathlib import Path


def get_project_root() -> Path:
    """获取项目根目录"""
    current_path = os.path.dirname(os.path.abspath(__file__))
    # print("项目根目录：", os.path.dirname(current_path))
    return Path(os.path.dirname(current_path))

def get_file_extension(file_path):
    # Get the file extension (suffix) from the file path
    _, extension = os.path.splitext(file_path)
    return extension

get_project_root = get_project_root()


if __name__ == '__main__':
    print(get_project_root)

    print("uploaded_files目录：", get_project_root.joinpath("uploaded_files"))
